<template>
  <div class="index-container">
    <div class="nav">
      <ul>
        <li>
          <router-link to="/discovery">
            <span class="iconfont icon-find-music">发现音乐</span>
          </router-link>
        </li>
        <li>
          <router-link to="/songList">
            <span class="iconfont icon-music-list">推荐歌单</span>
          </router-link>
        </li>
        <li>
          <router-link to="/songs">
            <span class="iconfont icon-music">最新音乐</span>
          </router-link>
        </li>
        <li>
          <router-link to="/mvs">
            <span class="iconfont icon-mv">最新MV</span>
          </router-link>
        </li>
      </ul>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>
    <div class="player">
      <audio
        id="audio"
        :volume="volume"
        :src="musicUrl"
        controls
        autoplay
      ></audio>
    </div>
  </div>
</template>

<script>
export default {
  name: 'index',
  data() {
    return {
      musicUrl: '',
      volume: 0.1,
      playList: [],
    }
  },

  watch: {
    volume() {
      document.getElementById('audio').volume = this.volume
    },
    playList() {
      console.log(this.playList)
    },
  },
}
</script>

<style >
</style>
